<template>
  <div v-if="show" class="storelist" :class="{hide:ishide}">
    <!-- 图标 -->
    <div @click="hidde" class="xialaicon">
      <img src="../../../assets/xiala.png" alt />
    </div>
    <!-- 标题 -->
    <div class="title">
      <div class="flex">
        <img src="../../../assets/images_test/1.png" alt />
        <div class="addres">
          <p>{{goodlist.b_d_info.b_d_name}}</p>
          <div class="tag">
            <li>导航去</li>
            <li>去看看</li>
            <li>运营商</li>
          </div>
        </div>
      </div>
    </div>
    <!-- 列表 -->
    <div class="item-box">
      <div class="item" v-for="item in goodlist.merc_list" :key="item.b_d_id" @click="goyyzx">
        <div class="flex">
          <img src="../../../assets/images_test/0.png" alt />
          <div>
            <div class="name">{{item.merc_name}}</div>
            <div class="addres">{{item.merc_address}}</div>
            <div class="info">{{item.merc_info}}</div>
          </div>
        </div>
        <!-- <div>{{item.merc_sys_tag}}</div> -->
        <div class="clearfix tag">
          <div v-for="arr in item.merc_sys_tag" :key="arr.b_d_id">{{arr}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Bus from "../../../utils/bus.js";

export default {
  name: "storelist",
  data() {
    return {
      message: "",
      show: false,
      ishide:false
    };
  },
  methods: {
    hidde() {
      this.show = false;
      // this.ishide = !this.ishide
    },
    //去运营中心页面
    goyyzx(){
      this.$router.push({  path: "/yunying" });
    }
  },
  mounted() {
    // let self = this;
    Bus.$on("msg", e => {
      this.message = e;
      this.goodlist = JSON.parse(this.message);
      console.log(this.goodlist);
      this.show = true;
      console.log(`传来的数据是：${e}`);
      //根据${e}请求对应列表数据...
    });
  },
  //   根据兄弟组件传过来的bd-id请求对应数据，填充到message
  created() {
    // this.$axios.post('http://192.168.0.107/api/map/bdfind',{       // 还可以直接把参数拼接在url后边
    //    "user_id":"1","b_d_id":"1"
    // }).then(function(res){
    //     console.log(res.data);
    //     // this.goodsList = res.data;
    // }).catch(function (error) {
    //     console.log(error);
    // });
  }
};
</script>

<style lang="less">
@keyframes slidup {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0%);
  }
}
.storelist {
  animation: slidup 0.3s ease-in both;
  font-size: 14px;
  padding: 9px;
  position: fixed;
  bottom: 0;
  background: #fff;
  width: 100%;
  height: 80%;
  border-radius: 15px 15px 0 0;
}

@keyframes hide {
  from {
    transform: translateY(0%);
  }

  to {
    transform: translateY(100%);
  }
}
.hide{
  animation: hide 0.3s ease-in both;
}
.xialaicon {
  text-align: center;
  img {
    width: 16px;
    height: 16px;
  }
}

.title {
  padding: 10px 12px 10px;
  p {
    font-size: 20px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 600;
    color: rgba(0, 0, 0, 1);
    margin-bottom: 10px;
  }
  .flex {
    display: flex;
    border-bottom: 1px solid #cccccc;
    padding-bottom: 12px;
    img {
      width: 60px;
      height: 60px;
      margin-right: 10px;
    }
    .tag {
      display: flex;
      justify-content: start;
    }
    .tag li {
      list-style: none;
      width: 50px;
      height: 25px;
      line-height: 25px;
      border-radius: 13px;
      border: 1px solid rgba(195, 12, 34, 1);
      text-align: center;
      margin-right: 10px;
      color: rgba(195, 12, 34, 1);
    }
  }
}

.item {
  padding: 10px 0 10px;
  border-bottom: 2px solid rgba(245, 245, 245, 1);
  .flex {
    display: flex;
  }
  .flex img {
    width: 116px;
    height: 84px;
  }
  .tag div {
    padding: 0 10px 0;
    line-height: 20px;
    margin-right: 10px;
    border: 1px solid rgba(195, 12, 34, 1);
    font-weight: 400;
    color: rgba(195, 12, 34, 1);
    float: left;
    margin-bottom: 12px;
    border-radius: 2px;
  }
  .name {
    font-size: 16px;
    font-weight: 600;
    font-family: PingFangSC-Medium, PingFang SC;
  }
  .info {
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: rgba(120, 120, 120, 1);
    line-height: 17px;
  }
  .addres{
    color: #F28764;
    background: #FEEFE9;
  }
}
</style>
